// 农机手
import request from '@/api/socialized-servce/index.js' //引入http.js
// import request from '@/api/index.js' //引入http.js
const api = request
export default {
	// 农机手查询订单
	queryMyOrder(params) {
		let url = 'service/service/order/queryServicerMyPageByCondition'
		return api.request(url, 'post', {
			...params
		})
	},
	// 开始服务
	startService(params) {
		let url = `service/service/order/execute/${params.orderNo}`
		return api.request(url, 'put')
	},
	// 完成服务
	completedService(orderNo, params) {
		let url = `service/service/order/finish/${orderNo}`
		return api.request(url, 'put', {
			...params
		})
	},
	// 申请调度
	applyScheduling(params) {
		let url = 'service/service/serviceApplyDispatch/apply'
		return api.request(url, 'post', {
			...params
		})
	},
	// 删除订单
	delOrder(id) {
		let url = `service/service/order/delServicer/${id}`
		return api.request(url, 'PUT')
	},
	delDispatchOrder(id) {
		let url = `service/service/order/delDispatcher/${id}`
		return api.request(url, 'PUT')
	},
	// 发起取消
	applayCancelOrder(params) {
		let url = `service/service/close/add/apply`
		return api.request(url, 'POST', {
			...params
		})
	},
	// 确认拒绝撤销取消服务
	confirmCancel(params) {
		let url = 'service/service/close/result'
		return api.request(url, 'POST', {
			...params
		})
	},
	// 订单投诉
	orderComplaint(params) {
		let url = 'service/service/serviceComplain/add/apply'
		return api.request(url, 'POST', {
			...params
		})
	},
	// 撤销投诉
	repealOrderComplaint(orderNo) {
		let url = `service/service/serviceComplain/quash/${orderNo}`
		return api.request(url, 'PUT')
	},
	// 已调度
	dispatchOrderList(params) {
		let url = 'service/service/order/queryServicerDispatchMyPageByCondition'
		return api.request(url,'post',{
			...params
		})
	},
	// 接单
	startApply(params) {
		let url = `service/service/order/accept`
		return api.request(url, 'put', {
			...params
		})
	},
}